package com.awaken;

import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;

/**
 * User: neveragny
 * Date: 03.04.2010
 */
public class AlarmList {
    List<AlarmOne> alarms;

    public AlarmList(){
        alarms = new ArrayList<AlarmOne>();
    }

    public List getAlarms() {
        return alarms;
    }

    public int getLength(){
        System.out.println("AlarmList become to: " + alarms.size());
        return alarms.size();
    }

    public void addAlarm(AlarmOne alarm){

        alarms.add(alarm);
        System.out.println(this.alarms.size());
    }

    public void setAlarms(List alarms) {
        this.alarms = alarms;
    }

    public AlarmOne getAlarmByTitle(String alarmTitle){
        for(AlarmOne aOne: alarms){
            if(aOne.getTitle().equals(alarmTitle)){
                return aOne;
            }
        }
        return null;
    }
}
